<?php

// ===============================================
// THIS SCRIPT CREATED BY 
// Name : Fairuz Abd Rahman
// Company : OOS SYNDICATE
//
// FOR MAJLIS PERBANDARAN LANGKAWI BANDAR PERLANCONGAN (MPLBP)
//
// https://www.e-kerajaan.com
// http://www.oosyndicate.com
//
// Email : mofbar@gmail.com
// Mobile : 0125894445
// ===============================================

require_once 'func_taksiran.php';
require_once 'func_sewaan.php';
require_once 'func_lesen.php';

$the_type 	= $_GET['type'];
$the_value 	= $_GET['value'];
$the_return	= $_GET['return'];

if(!empty($the_type) && !empty($the_value) && !empty($the_return)) {
    
	if ($the_type == 'taksiran') {
		$taksiran_account = getdetail_user_taksiran($the_value);
		
		if (!empty($taksiran_account)) {
			if ($the_return == "amount") {
				echo total_taksiran($taksiran_account);
			} else if ($the_return == "json") {
				json_taksiran($taksiran_account);
			}
		}
	}
	
	if ($the_type == 'sewaan') {
		$sewaan_account = getdetail_user_sewaan($the_value);
		
		if (!empty($sewaan_account)) {
			if ($the_return == "amount") {
				echo total_sewaan($sewaan_account);
			} else if ($the_return == "json") {
				json_sewaan($sewaan_account);
			}
		}
	}
	
	if ($the_type == 'lesen') {
		$lesen_account = getdetail_user_lesen($the_value);
		
		if (!empty($lesen_account)) {
			if ($the_return == "amount") {
				echo total_lesen($lesen_account);
			} else if ($the_return == "json") {
				json_lesen($lesen_account);
			}
		}
	}
}

?>